package com.chenhs.oop.study.多线程;

/**
 * @program: JAVA300
 * @description: 基本介绍
 * @author: peanut
 * @create: 2019-07-18 21:45
 */
public class Demo1  extends Thread{


    @Override
    public void run() {
        for (int i = 0; i < 10000; i++) {
            System.out.println("多线程方法");
        }
    }

    /*线程的四种实现方式*/
    /*方式一继承 Thread*/
    class Xc1 extends Thread {
        @Override
        public void run() {

        }

    }

    /*方法二implemntds Runnanle */
    class Xc2 implements Runnable {

        @Override
        public void run() {

        }
    }
    /*方式三实现Callable接口*/

    /*方式四 线程池*/
    public static void main(String[] args) {
        Demo1 demo1 = new Demo1();
        demo1.start();
        for (int i = 0; i <10000 ; i++) {
            System.out.println("main方法中的方法");
        }
}
}

